<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="jakarta.tags.core" %>

<!-- 顶部导航 -->
<div class="top-nav">
  <div class="search-box">
    <i class="fas fa-search"></i>
    <input type="text" placeholder="搜索...">
  </div>

  <div class="user-profile">
      <c:choose>
        <c:when test="${sessionScope.loginAdmin.headpic != null && sessionScope.loginAdmin.headpic != ''}">
          <img src="statics/images/adminHead/${sessionScope.loginAdmin.headpic}" alt="用户头像">
        </c:when>
        <c:otherwise>
          <img src="statics/images/adminHead/admin.png" alt="默认头像">
        </c:otherwise>
      </c:choose>
      <div>
        <div>
          <c:choose>
            <c:when test="${sessionScope.loginAdmin.type == 1}">病人:${sessionScope.loginAdmin.username}</c:when>
            <c:when test="${sessionScope.loginAdmin.type == 2}">医生:${sessionScope.loginAdmin.username}</c:when>
            <c:when test="${sessionScope.loginAdmin.type == 3}">管理员:${sessionScope.loginAdmin.username}</c:when>
            <c:otherwise>${sessionScope.loginAdmin.username}</c:otherwise>
          </c:choose>
        </div>
        <small><a href="logout">退出</a></small>
      </div>
    </div>
</div>